package com.baichang.taoshunda.weixin.tencent;


import com.baichang.framework.utils.ConfigurationHandle;

/**
 * User: rizenguo
 * Date: 2014/10/29
 * Time: 14:40
 * 这里放置各种配置数据
 */
public class CompanyConfigure {


    //微信支付回调通知路径
    public static String NOTIFY_URL;

    //KEY
    public static String KEY;

    //微信分配的公众号ID（开通公众号之后可以获取到）
    public static String APP_ID ;

    public static String APP_SECRET ;

    //微信支付分配的商户号ID（开通公众号的微信支付功能之后可以获取到）
    public static String MCH_ID ;

    //HTTPS证书的本地路径
    private static String CERTLOCALPATH;

    //机器IP
    private static String IP = "";

    public static boolean isDebug = false;

    //退款的路径
    public static String  RefundCertificateAddress ;

    static {
        ConfigurationHandle handle = new ConfigurationHandle("company.weixin.properties");

        IP = handle.getStringValue("IP");
        NOTIFY_URL = handle.getStringValue("NOTIFY_URL");
        KEY = handle.getStringValue("KEY");
        APP_ID = handle.getStringValue("APP_ID");
        APP_SECRET = handle.getStringValue("APP_SECRET");
        MCH_ID = handle.getStringValue("MCH_ID");
        CERTLOCALPATH = handle.getStringValue("CERTLOCALPATH");
        isDebug =  handle.getStringValue("ISDEBUG").equals("1");
        RefundCertificateAddress = handle.getStringValue("RefundCertificateAddress");
    }


    //以下是几个API的路径：
    //1）统一下单
    public static String PAY_UNFIFIEDORDER = "https://api.mch.weixin.qq.com/pay/unifiedorder";

    //1）被扫支付API
    public static String PAY_API = "https://api.mch.weixin.qq.com/pay/micropay";

    //2）被扫支付查询API
    public static String PAY_QUERY_API = "https://api.mch.weixin.qq.com/pay/orderquery";

    //3）退款API
    public static String REFUND_API = "https://api.mch.weixin.qq.com/secapi/pay/refund";

    //4）退款查询API
    public static String REFUND_QUERY_API = "https://api.mch.weixin.qq.com/pay/refundquery";

    //5）撤销API
    public static String REVERSE_API = "https://api.mch.weixin.qq.com/secapi/pay/reverse";

    //6）下载对账单API
    public static String DOWNLOAD_BILL_API = "https://api.mch.weixin.qq.com/pay/downloadbill";

    //7) 统计上报API
    public static String REPORT_API = "https://api.mch.weixin.qq.com/payitil/report";




    public static void setKEY(String KEY) {
        CompanyConfigure.KEY = KEY;
    }

    public static void setCERTLOCALPATH(String CERTLOCALPATH) {
        CompanyConfigure.CERTLOCALPATH = CERTLOCALPATH;
    }

    public static void setIP(String IP) {
        CompanyConfigure.IP = IP;
    }

    public static String getKEY() {
        return KEY;
    }

    public static String getCERTLOCALPATH() {
        return CERTLOCALPATH;
    }

    public static String getIP() {
        return IP;
    }


}
